package action.manage;

import java.util.List;

import model.app.AppInfo;

import service.app.InfoService;
import util.Tool;
import core.action.BaseAction;
import exception.Exceptions;

public class InfoManageAction extends BaseAction{
	private InfoService infoService;
	private List<AppInfo> infoList;
	private String id;
	private String value;
	
	public String execute(){
		infoList=infoService.getInfoList();
		return "success";
	}
	public String Edit() throws Exceptions{
		String[] idlist=Tool.splitArrayHtml(id);
		String[] valuelist=Tool.splitArrayHtml(value);
		for(int i=0;i<idlist.length;i++){
			AppInfo info=infoService.getOne(Integer.valueOf(idlist[i]));
			info.setValue(valuelist[i]);
			infoService.save_in_AppInfo(info);
		}
		MessageJump("公司基本信息修改成功！","infoManage");
		
		return "message";
	}

	public InfoService getInfoService() {
		return infoService;
	}

	public void setInfoService(InfoService infoService) {
		this.infoService = infoService;
	}

	public List<AppInfo> getInfoList() {
		return infoList;
	}

	public void setInfoList(List<AppInfo> infoList) {
		this.infoList = infoList;
	}
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	}
	public String getValue() {
		return value;
	}
	public void setValue(String value) {
		this.value = value;
	}

}
